//
//  ViewController.swift
//  photo
//
//  Created by zhongchuren on 2018/11/19.
//  Copyright © 2018年 sundusk. All rights reserved.
//

import UIKit
import SnapKit
class ViewController: UIViewController {
    let ScreenWidth  = UIScreen.main.bounds.width
    let ScreenHeight = UIScreen.main.bounds.height
   
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        self.view.backgroundColor = UIColor.blue
        let add = UIButton(frame: CGRect(x: 100, y: 100, width: 100, height: 50))
        self.view.addSubview(add)
        add.tag = 1
        add.setTitle("跳转", for: UIControl.State.normal)
        add.setTitleColor(UIColor.red, for: UIControl.State.normal)
        add.addTarget(self, action:#selector(acttin), for: UIControl.Event.touchUpInside)
        
        let add1 = UIButton(frame: CGRect(x: 200, y: 100, width: 100, height: 50))
        self.view.addSubview(add1)
        add1.tag = 2
        add1.setTitle("相册", for: UIControl.State.normal)
        add1.setTitleColor(UIColor.red, for: UIControl.State.normal)
        add1.addTarget(self, action:#selector(acttin), for: UIControl.Event.touchUpInside)
      
    }
    
    @objc func acttin(sender:UIButton){
        
        
        if sender.tag == 1{
            let secondVC = CCQWriteCommentViewController()
            //        self.present(secondVC, animated: true, completion: nil)
            
            
            self.navigationController?.pushViewController(secondVC, animated: true)
        }else{
            let secondVC = CCQPhotoAlbumViewController()
       
            
            
            self.navigationController?.pushViewController(secondVC, animated: true)
            
        }
       
        
     
    }


}

